package com.zzz.demo.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * user 实体类
 */
@Document
@Data
@NoArgsConstructor
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    // @id这个注解来对应mongo的_id这个字段
    @Id
    private String id;
    private String name;
    private String gender;
    private int age;
    private String email;

}